package leetcode.jianzhioffer;

import java.util.HashSet;
import java.util.Set;

/**
 * @program: datastructureandalogorithm
 * @description:
 * @author: hmx
 * @create: 2021-10-27 14:01
 **/
public class JianZhiOffer03 {

    public int findRepeatNumber(int[] nums) {
        Set<Integer> set = new HashSet<>();
        for (int i = 0; i < nums.length; i++) {
            if (!set.contains(nums[i])) {
                set.add(nums[i]);
            }
            return nums[i];
        }
        return 666666;
    }

}
